extends Camera3D

@export var speed := 44.0 
@export var default_fov := 75.0
var is_aiming: bool = false
var target_fov :float
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	pass

func _physics_process(delta: float) -> void:
	if is_aiming:
		fov = lerp(fov,target_fov,delta * 20)

	
func _unhandled_input(event: InputEvent) -> void:
	if event.is_action_released("aim"):
		fov = default_fov
		is_aiming = false


func _on_player_aim(multiple: float) -> void:
		target_fov = default_fov * multiple
		is_aiming = true

